package com.panasonic.cn.cmsc;

import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.sql.SQLException;
import com.fujitsu.fks.jaaf.core.*;

public class SQLMM0304{
	private Hashtable paramsString     = new Hashtable();
	private Hashtable paramsBigDecimal = new Hashtable();
	private Hashtable paramsFree       = new Hashtable();
	private String lastSql_ = null;

	private String getString(String name){
		if(name==null) return "";
		String returnStr = (String)paramsString.get(name);
		if(returnStr==null) return "";
		return "'"+FrameworkCommon.stringReplaceSQuote(returnStr)+"'";
	}

	private String getBigDecimal(String name){
		if(name==null) return "";
		BigDecimal returnStr = (BigDecimal)paramsBigDecimal.get(name);
		if(returnStr==null) return "";
		return returnStr.toString();
	}

	private String getFree(String name){
		if(name==null) return "";
		String returnStr = (String)paramsFree.get(name);
		if(returnStr==null) return "";
		return returnStr;
	}

	public String getLastSql(){
		return lastSql_;
	}

	public int UPDATE_M0301(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" UPDATE M03");
		sql.append(" SET");
		sql.append(" APL_EDT "+((getString("APL_EDT").equals(""))?" is null ":"=")+getString("APL_EDT")+",");
		sql.append(" UPD_DTTM = TO_DATE("+getString("UPD_DTTM")+",'YYYYMMDDHH24MISS'),");
		sql.append(" UPD_CHRG_CD "+((getString("UPD_CHRG_CD").equals(""))?" is null ":"=")+getString("UPD_CHRG_CD")+",");
		sql.append(" UPD_PGID "+((getString("UPD_PGID").equals(""))?" is null ":"=")+getString("UPD_PGID")+",");
		sql.append(" FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append(" WHERE");
		sql.append(" SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+"");
		sql.append(" AND");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int UPDATE_M0302(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" UPDATE M03");
		sql.append(" SET");
		sql.append(" UPD_DTTM = TO_DATE("+getString("UPD_DTTM")+",'YYYYMMDDHH24MISS'),");
		sql.append(" UPD_CHRG_CD "+((getString("UPD_CHRG_CD").equals(""))?" is null ":"=")+getString("UPD_CHRG_CD")+",");
		sql.append(" UPD_PGID "+((getString("UPD_PGID").equals(""))?" is null ":"=")+getString("UPD_PGID")+",");
		sql.append(" FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append(" WHERE");
		sql.append(" SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+"");
		sql.append(" AND");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int UPDATE_M0303(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" UPDATE M03");
		sql.append(" SET");
		sql.append(" APL_EDT "+((getString("APL_EDT").equals(""))?" is null ":"=")+getString("APL_EDT")+",");
		sql.append(" UPD_DTTM = TO_DATE("+getString("UPD_DTTM")+",'YYYYMMDDHH24MISS'),");
		sql.append(" UPD_CHRG_CD "+((getString("UPD_CHRG_CD").equals(""))?" is null ":"=")+getString("UPD_CHRG_CD")+",");
		sql.append(" UPD_PGID "+((getString("UPD_PGID").equals(""))?" is null ":"=")+getString("UPD_PGID")+",");
		sql.append(" FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append(" WHERE");
		sql.append(" SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+"");
		sql.append(" AND");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+"");
		sql.append(" AND");
		sql.append(" APL_BDT <"+((getString("SYSDATE").equals(""))?" is null ":"=")+getString("SYSDATE")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("SYSDATE").equals(""))?" is null ":"=")+getString("SYSDATE")+"");
		sql.append(" AND FM_TYP <> "+getString("NOT_FM_TYP")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public SelectResultRset SELECT_M0301(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" NVL( SLCP_CD,'') AS SLCP_CD,");
		sql.append(" NVL( ITM_NO,'') AS ITM_NO,");
		sql.append(" NVL( APL_BDT,'') AS APL_BDT,");
		sql.append(" NVL( APL_EDT,'') AS APL_EDT,");
		sql.append(" NVL( GNR_ADM_NO,'') AS GNR_ADM_NO,");
		sql.append(" NVL( TMP_AC_TYP,'') AS TMP_AC_TYP,");
		sql.append(" NVL( SPLR_CD,'') AS SPLR_CD,");
		sql.append(" NVL( BPLN_YR,'') AS BPLN_YR,");
		sql.append(" NVL( NW_ITM_NO_TYP,'') AS NW_ITM_NO_TYP,");
		sql.append(" NVL( N_I_N_R_PLN_DT,'') AS N_I_N_R_PLN_DT,");
		sql.append(" NVL( MFCC_CD,'') AS MFCC_CD,");
		sql.append(" NVL( ODR_DVSN_CD,'') AS ODR_DVSN_CD,");
		sql.append(" NVL( DSP_SPCF_CTNT,'') AS DSP_SPCF_CTNT,");
		sql.append(" NVL( PKG_MSR,'') AS PKG_MSR,");
		sql.append(" NVL( SLS_TRDT_CD,'') AS SLS_TRDT_CD,");
		sql.append(" NVL( SLS_CRCY_CD,'') AS SLS_CRCY_CD,");
		sql.append(" NVL( SLS_UP_APL_BGN_DT,'') AS SLS_UP_APL_BGN_DT,");
		sql.append(" NVL( SLS_UP_APL_END_DT,'') AS SLS_UP_APL_END_DT,");
		sql.append(" NVL( SLS_UP,'') AS SLS_UP,");
		sql.append(" NVL( SLS_UP_D_L_PLC,'') AS SLS_UP_D_L_PLC,");
		sql.append(" NVL( SLS_UP_APL_BGN_DT2 ,'') AS SLS_UP_APL_BGN_DT2,");
		sql.append(" NVL( SLS_UP_APL_END_DT2 ,'') AS SLS_UP_APL_END_DT2,");
		sql.append(" NVL( SLS_UP2,'') AS SLS_UP2,");
		sql.append(" NVL( SLS_UP_D_L_PLC2,'') AS SLS_UP_D_L_PLC2,");
		sql.append(" NVL( I_N_S_DCTN_DT,'') AS I_N_S_DCTN_DT,");
		sql.append(" NVL( B_BPLN_ITM_NO,'') AS B_BPLN_ITM_NO,");
		sql.append(" NVL( RPL_DVSN_CD,'') AS RPL_DVSN_CD,");
		sql.append(" NVL( GFT_ITM_TYP,'') AS GFT_ITM_TYP,");
		sql.append(" NVL( IMP_ITM_TYP,'') AS IMP_ITM_TYP,");
		sql.append(" NVL( DSP_ITM_TYP,'') AS DSP_ITM_TYP,");
		sql.append(" NVL( CNSMT_ITM_TYP,'') AS CNSMT_ITM_TYP,");
		sql.append(" NVL( SLS_PRMT_ITM_TYP,'') AS SLS_PRMT_ITM_TYP,");
		sql.append(" NVL( PUR_ITM_TYP,'') AS PUR_ITM_TYP,");
		sql.append(" NVL( SLS_INNR_P_RT,'') AS SLS_INNR_P_RT,");
		sql.append(" NVL( SLS_INNR_D_P_L_PLC,'') AS SLS_INNR_D_P_L_PLC,");
		sql.append(" NVL( SLS_INNR_P_RND_TYP,'') AS SLS_INNR_P_RND_TYP,");
		sql.append(" NVL( SLS_STD_S_PRIZ,'') AS SLS_STD_S_PRIZ,");
		sql.append(" NVL( SLS_TMP_S_PRIZ_TYP,'') AS SLS_TMP_S_PRIZ_TYP,");
		sql.append(" NVL( SLS_ODR_QTY_STD,'') AS SLS_ODR_QTY_STD,");
		sql.append(" NVL( SLS_ODR_QTY_MAX,'') AS SLS_ODR_QTY_MAX,");
		sql.append(" NVL( SLS_ODR_QTY_MIN,'') AS SLS_ODR_QTY_MIN,");
		sql.append(" NVL( BPLN_PUR_PRIZ,'') AS BPLN_PUR_PRIZ,");
		sql.append(" NVL( BPLN_SLS_PRIZ,'') AS BPLN_SLS_PRIZ,");
		sql.append(" NVL( SLS_S_BGN_DT,'') AS SLS_S_BGN_DT,");
		sql.append(" NVL( SLS_S_END_DT,'') AS SLS_S_END_DT,");
		sql.append(" NVL( REAR_WHRS_CD,'') AS REAR_WHRS_CD,");
		sql.append(" NVL( SLS_ITM_ADM_TYP,'') AS SLS_ITM_ADM_TYP,");
		sql.append(" NVL( SLS_CAT_LRG,'') AS SLS_CAT_LRG,");
		sql.append(" NVL( SLS_CAT_MID,'') AS SLS_CAT_MID,");
		sql.append(" NVL( SLS_CAT_SML,'') AS SLS_CAT_SML,");
		sql.append(" NVL( SLS_SLS_DEPT,'') AS SLS_SLS_DEPT,");
		sql.append(" NVL( PUR_UM,'') AS PUR_UM,");
		sql.append(" NVL( INV_PUR_EXC_RT,'') AS INV_PUR_EXC_RT,");
		sql.append(" NVL( INV_UM,'') AS INV_UM,");
		sql.append(" NVL( DLVY_INV_EXC_RT,'') AS DLVY_INV_EXC_RT,");
		sql.append(" NVL( DLVY_UM,'') AS DLVY_UM,");
		sql.append(" NVL( ADD_PRIZ_TAX_CD,'') AS ADD_PRIZ_TAX_CD,");
		sql.append(" NVL( ADD_PRIZ_CAL_TYP,'') AS ADD_PRIZ_CAL_TYP,");
		sql.append(" NVL( ODR_MTHD,'') AS ODR_MTHD,");
		sql.append(" NVL( SLS_SLS_CST_AC,'') AS SLS_SLS_CST_AC,");
		sql.append(" NVL( EMP1_ITM_TYP,'') AS EMP1_ITM_TYP,");
		sql.append(" NVL( EMP2_ITM_TYP,'') AS EMP2_ITM_TYP,");
		sql.append(" NVL( EMP3_ITM_TYP,'') AS EMP3_ITM_TYP,");
		sql.append(" NVL( EMP4_ITM_TYP,'') AS EMP4_ITM_TYP,");
		sql.append(" NVL( EMP5_ITM_TYP,'') AS EMP5_ITM_TYP,");
		sql.append(" NVL( MAKER_KANSI_TYP,'') AS MAKER_KANSI_TYP,");
		sql.append(" NVL( PSI_ITM_TYP,'') AS PSI_ITM_TYP,");
		sql.append(" NVL( SLS_MIN_S_PRIZ,'') AS SLS_MIN_S_PRIZ,");
		sql.append(" NVL( SLS_PUR_PRIZ,'') AS SLS_PUR_PRIZ,");
		sql.append(" TO_CHAR(NVL( RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM,");
		sql.append(" NVL( RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append(" NVL( RGS_PGID,'') AS RGS_PGID,");
		sql.append(" TO_CHAR(NVL( UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM,");
		sql.append(" NVL( UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append(" NVL( UPD_PGID,'') AS UPD_PGID,");
		sql.append(" NVL( FM_TYP,'') AS FM_TYP");
		sql.append(" FROM");
		sql.append(" M03");
		sql.append(" WHERE");
		sql.append(" SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+"");
		sql.append(" AND");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" ORDER BY ITM_NO,APL_BDT");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_M0302(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" COUNT(*) AS COUNTS");
		sql.append(" FROM");
		sql.append(" M03");
		sql.append(" WHERE");
		sql.append(" SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+"");
		sql.append(" AND");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" TO_CHAR(NVL( UPD_DTTM,''),'YYYYMMDDHH24MISS') "+((getString("UPD_DTTM").equals(""))?" is null ":"=")+getString("UPD_DTTM")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("NOT_FM_TYP")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_M0201(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" ODR_DVSN_CD,");
		sql.append(" TMP_AC_TYP,");
		sql.append(" SLS_QTY_UN_CD,");
		sql.append(" SLC_PRMT_ITM_TYP,");
		sql.append(" KIT_TYP,");
		sql.append(" GFT_TYP,");
		sql.append(" FOC_TYP,");
		sql.append(" MIN_ODR_QTY,");
		sql.append(" STD_PKG_SZ,");
		sql.append(" STD_PKG_WDTH,");
		sql.append(" STD_PKG_HI,");
		sql.append(" STD_PKG_WGT,");
		sql.append(" TMP_PRIZ_TYP,");
		sql.append(" STD_UP,");
		sql.append(" ITM_NM_CN,");
		sql.append(" SLS_ROUT_TYP,");
		sql.append(" ITM_NET_WGT");
		sql.append(" FROM M02");
		sql.append(" WHERE");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+"");
		sql.append(" AND");
		sql.append(" ODR_DVSN_CD "+((getString("ODR_DVSN_CD").equals(""))?" is null ":"=")+getString("ODR_DVSN_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT <"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("APL_EDT").equals(""))?" is null ":"=")+getString("APL_EDT")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("NOT_FM_TYP_6")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("NOT_FM_TYP_9")+"");
		sql.append(" ORDER BY APL_BDT DESC");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_M0202(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" ODR_DVSN_CD,");
		sql.append(" TMP_AC_TYP,");
		sql.append(" SLS_QTY_UN_CD,");
		sql.append(" SLC_PRMT_ITM_TYP,");
		sql.append(" KIT_TYP,");
		sql.append(" GFT_TYP,");
		sql.append(" FOC_TYP,");
		sql.append(" MIN_ODR_QTY,");
		sql.append(" STD_PKG_SZ,");
		sql.append(" STD_PKG_WDTH,");
		sql.append(" STD_PKG_HI,");
		sql.append(" STD_PKG_WGT,");
		sql.append(" TMP_PRIZ_TYP,");
		sql.append(" STD_UP,");
		sql.append(" ITM_NM_CN,");
		sql.append(" SLS_ROUT_TYP,");
		sql.append(" ITM_NET_WGT");
		sql.append(" FROM M02");
		sql.append(" WHERE");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+"");
		sql.append(" AND");
		sql.append(" APL_BDT <"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("APL_EDT").equals(""))?" is null ":"=")+getString("APL_EDT")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("NOT_FM_TYP_6")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("NOT_FM_TYP_9")+"");
		sql.append(" ORDER BY APL_BDT DESC");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public int INSERT_BM0301(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" INSERT INTO BM03(");
		sql.append(" SEQ_NO,");
		sql.append(" SLCP_CD,");
		sql.append(" ITM_NO,");
		sql.append(" APL_BDT,");
		sql.append(" APL_EDT,");
		sql.append(" GNR_ADM_NO,");
		sql.append(" TMP_AC_TYP,");
		sql.append(" SPLR_CD,");
		sql.append(" BPLN_YR,");
		sql.append(" NW_ITM_NO_TYP,");
		sql.append(" N_I_N_R_PLN_DT,");
		sql.append(" MFCC_CD,");
		sql.append(" ODR_DVSN_CD,");
		sql.append(" DSP_SPCF_CTNT,");
		sql.append(" PKG_MSR,");
		sql.append(" SLS_TRDT_CD,");
		sql.append(" SLS_CRCY_CD,");
		sql.append(" SLS_UP_APL_BGN_DT,");
		sql.append(" SLS_UP_APL_END_DT,");
		sql.append(" SLS_UP,");
		sql.append(" SLS_UP_D_L_PLC,");
		sql.append(" SLS_UP_APL_BGN_DT2,");
		sql.append(" SLS_UP_APL_END_DT2,");
		sql.append(" SLS_UP2,");
		sql.append(" SLS_UP_D_L_PLC2,");
		sql.append(" I_N_S_DCTN_DT,");
		sql.append(" B_BPLN_ITM_NO,");
		sql.append(" RPL_DVSN_CD,");
		sql.append(" GFT_ITM_TYP,");
		sql.append(" IMP_ITM_TYP,");
		sql.append(" DSP_ITM_TYP,");
		sql.append(" CNSMT_ITM_TYP,");
		sql.append(" SLS_PRMT_ITM_TYP,");
		sql.append(" PUR_ITM_TYP,");
		sql.append(" SLS_INNR_P_RT,");
		sql.append(" SLS_INNR_D_P_L_PLC,");
		sql.append(" SLS_INNR_P_RND_TYP,");
		sql.append(" SLS_STD_S_PRIZ,");
		sql.append(" SLS_TMP_S_PRIZ_TYP,");
		sql.append(" SLS_ODR_QTY_STD,");
		sql.append(" SLS_ODR_QTY_MAX,");
		sql.append(" SLS_ODR_QTY_MIN,");
		sql.append(" BPLN_PUR_PRIZ,");
		sql.append(" BPLN_SLS_PRIZ,");
		sql.append(" SLS_S_BGN_DT,");
		sql.append(" SLS_S_END_DT,");
		sql.append(" REAR_WHRS_CD,");
		sql.append(" SLS_ITM_ADM_TYP,");
		sql.append(" SLS_CAT_LRG,");
		sql.append(" SLS_CAT_MID,");
		sql.append(" SLS_CAT_SML,");
		sql.append(" SLS_SLS_DEPT,");
		sql.append(" PUR_UM,");
		sql.append(" INV_PUR_EXC_RT,");
		sql.append(" INV_UM,");
		sql.append(" DLVY_INV_EXC_RT,");
		sql.append(" DLVY_UM,");
		sql.append(" ADD_PRIZ_TAX_CD,");
		sql.append(" ADD_PRIZ_CAL_TYP,");
		sql.append(" ODR_MTHD,");
		sql.append(" SLS_SLS_CST_AC,");
		sql.append(" EMP1_ITM_TYP,");
		sql.append(" EMP2_ITM_TYP,");
		sql.append(" EMP3_ITM_TYP,");
		sql.append(" EMP4_ITM_TYP,");
		sql.append(" EMP5_ITM_TYP,");
		sql.append(" MAKER_KANSI_TYP,");
		sql.append(" PSI_ITM_TYP,");
		sql.append(" SLS_MIN_S_PRIZ,");
		sql.append(" SLS_PUR_PRIZ,");
		sql.append(" RGS_DTTM,");
		sql.append(" RGS_CHRG_CD,");
		sql.append(" RGS_PGID,");
		sql.append(" UPD_DTTM,");
		sql.append(" UPD_CHRG_CD,");
		sql.append(" UPD_PGID,");
		sql.append(" FM_TYP)");
		sql.append(" select SEQ_BM03.NEXTVAL,");
		sql.append(" SLCP_CD,");
		sql.append(" ITM_NO,");
		sql.append(" APL_BDT,");
		sql.append(" APL_EDT,");
		sql.append(" GNR_ADM_NO,");
		sql.append(" TMP_AC_TYP,");
		sql.append(" SPLR_CD,");
		sql.append(" BPLN_YR,");
		sql.append(" NW_ITM_NO_TYP,");
		sql.append(" N_I_N_R_PLN_DT,");
		sql.append(" MFCC_CD,");
		sql.append(" ODR_DVSN_CD,");
		sql.append(" DSP_SPCF_CTNT,");
		sql.append(" PKG_MSR,");
		sql.append(" SLS_TRDT_CD,");
		sql.append(" SLS_CRCY_CD,");
		sql.append(" SLS_UP_APL_BGN_DT,");
		sql.append(" SLS_UP_APL_END_DT,");
		sql.append(" SLS_UP,");
		sql.append(" SLS_UP_D_L_PLC,");
		sql.append(" SLS_UP_APL_BGN_DT2,");
		sql.append(" SLS_UP_APL_END_DT2,");
		sql.append(" SLS_UP2,");
		sql.append(" SLS_UP_D_L_PLC2,");
		sql.append(" I_N_S_DCTN_DT,");
		sql.append(" B_BPLN_ITM_NO,");
		sql.append(" RPL_DVSN_CD,");
		sql.append(" GFT_ITM_TYP,");
		sql.append(" IMP_ITM_TYP,");
		sql.append(" DSP_ITM_TYP,");
		sql.append(" CNSMT_ITM_TYP,");
		sql.append(" SLS_PRMT_ITM_TYP,");
		sql.append(" PUR_ITM_TYP,");
		sql.append(" SLS_INNR_P_RT,");
		sql.append(" SLS_INNR_D_P_L_PLC,");
		sql.append(" SLS_INNR_P_RND_TYP,");
		sql.append(" SLS_STD_S_PRIZ,");
		sql.append(" SLS_TMP_S_PRIZ_TYP,");
		sql.append(" SLS_ODR_QTY_STD,");
		sql.append(" SLS_ODR_QTY_MAX,");
		sql.append(" SLS_ODR_QTY_MIN,");
		sql.append(" BPLN_PUR_PRIZ,");
		sql.append(" BPLN_SLS_PRIZ,");
		sql.append(" SLS_S_BGN_DT,");
		sql.append(" SLS_S_END_DT,");
		sql.append(" REAR_WHRS_CD,");
		sql.append(" SLS_ITM_ADM_TYP,");
		sql.append(" SLS_CAT_LRG,");
		sql.append(" SLS_CAT_MID,");
		sql.append(" SLS_CAT_SML,");
		sql.append(" SLS_SLS_DEPT,");
		sql.append(" PUR_UM,");
		sql.append(" INV_PUR_EXC_RT,");
		sql.append(" INV_UM,");
		sql.append(" DLVY_INV_EXC_RT,");
		sql.append(" DLVY_UM,");
		sql.append(" ADD_PRIZ_TAX_CD,");
		sql.append(" ADD_PRIZ_CAL_TYP,");
		sql.append(" ODR_MTHD,");
		sql.append(" SLS_SLS_CST_AC,");
		sql.append(" EMP1_ITM_TYP,");
		sql.append(" EMP2_ITM_TYP,");
		sql.append(" EMP3_ITM_TYP,");
		sql.append(" EMP4_ITM_TYP,");
		sql.append(" EMP5_ITM_TYP,");
		sql.append(" MAKER_KANSI_TYP,");
		sql.append(" PSI_ITM_TYP,");
		sql.append(" SLS_MIN_S_PRIZ,");
		sql.append(" SLS_PUR_PRIZ,");
		sql.append(" RGS_DTTM,");
		sql.append(" RGS_CHRG_CD,");
		sql.append(" RGS_PGID,");
		sql.append(" UPD_DTTM,");
		sql.append(" UPD_CHRG_CD,");
		sql.append(" UPD_PGID,");
		sql.append(" FM_TYP");
		sql.append(" FROM M03 WHERE");
		sql.append(" SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+" AND");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int INSERT_BM0302(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" INSERT INTO BM03(");
		sql.append(" SEQ_NO,");
		sql.append(" SLCP_CD,");
		sql.append(" ITM_NO,");
		sql.append(" APL_BDT,");
		sql.append(" APL_EDT,");
		sql.append(" GNR_ADM_NO,");
		sql.append(" TMP_AC_TYP,");
		sql.append(" SPLR_CD,");
		sql.append(" BPLN_YR,");
		sql.append(" NW_ITM_NO_TYP,");
		sql.append(" N_I_N_R_PLN_DT,");
		sql.append(" MFCC_CD,");
		sql.append(" ODR_DVSN_CD,");
		sql.append(" DSP_SPCF_CTNT,");
		sql.append(" PKG_MSR,");
		sql.append(" SLS_TRDT_CD,");
		sql.append(" SLS_CRCY_CD,");
		sql.append(" SLS_UP_APL_BGN_DT,");
		sql.append(" SLS_UP_APL_END_DT,");
		sql.append(" SLS_UP,");
		sql.append(" SLS_UP_D_L_PLC,");
		sql.append(" SLS_UP_APL_BGN_DT2,");
		sql.append(" SLS_UP_APL_END_DT2,");
		sql.append(" SLS_UP2,");
		sql.append(" SLS_UP_D_L_PLC2,");
		sql.append(" I_N_S_DCTN_DT,");
		sql.append(" B_BPLN_ITM_NO,");
		sql.append(" RPL_DVSN_CD,");
		sql.append(" GFT_ITM_TYP,");
		sql.append(" IMP_ITM_TYP,");
		sql.append(" DSP_ITM_TYP,");
		sql.append(" CNSMT_ITM_TYP,");
		sql.append(" SLS_PRMT_ITM_TYP,");
		sql.append(" PUR_ITM_TYP,");
		sql.append(" SLS_INNR_P_RT,");
		sql.append(" SLS_INNR_D_P_L_PLC,");
		sql.append(" SLS_INNR_P_RND_TYP,");
		sql.append(" SLS_STD_S_PRIZ,");
		sql.append(" SLS_TMP_S_PRIZ_TYP,");
		sql.append(" SLS_ODR_QTY_STD,");
		sql.append(" SLS_ODR_QTY_MAX,");
		sql.append(" SLS_ODR_QTY_MIN,");
		sql.append(" BPLN_PUR_PRIZ,");
		sql.append(" BPLN_SLS_PRIZ,");
		sql.append(" SLS_S_BGN_DT,");
		sql.append(" SLS_S_END_DT,");
		sql.append(" REAR_WHRS_CD,");
		sql.append(" SLS_ITM_ADM_TYP,");
		sql.append(" SLS_CAT_LRG,");
		sql.append(" SLS_CAT_MID,");
		sql.append(" SLS_CAT_SML,");
		sql.append(" SLS_SLS_DEPT,");
		sql.append(" PUR_UM,");
		sql.append(" INV_PUR_EXC_RT,");
		sql.append(" INV_UM,");
		sql.append(" DLVY_INV_EXC_RT,");
		sql.append(" DLVY_UM,");
		sql.append(" ADD_PRIZ_TAX_CD,");
		sql.append(" ADD_PRIZ_CAL_TYP,");
		sql.append(" ODR_MTHD,");
		sql.append(" SLS_SLS_CST_AC,");
		sql.append(" EMP1_ITM_TYP,");
		sql.append(" EMP2_ITM_TYP,");
		sql.append(" EMP3_ITM_TYP,");
		sql.append(" EMP4_ITM_TYP,");
		sql.append(" EMP5_ITM_TYP,");
		sql.append(" MAKER_KANSI_TYP,");
		sql.append(" PSI_ITM_TYP,");
		sql.append(" SLS_MIN_S_PRIZ,");
		sql.append(" SLS_PUR_PRIZ,");
		sql.append(" RGS_DTTM,");
		sql.append(" RGS_CHRG_CD,");
		sql.append(" RGS_PGID,");
		sql.append(" UPD_DTTM,");
		sql.append(" UPD_CHRG_CD,");
		sql.append(" UPD_PGID,");
		sql.append(" FM_TYP)");
		sql.append(" select SEQ_BM03.NEXTVAL,");
		sql.append(" SLCP_CD,");
		sql.append(" ITM_NO,");
		sql.append(" APL_BDT,");
		sql.append(" APL_EDT,");
		sql.append(" GNR_ADM_NO,");
		sql.append(" TMP_AC_TYP,");
		sql.append(" SPLR_CD,");
		sql.append(" BPLN_YR,");
		sql.append(" NW_ITM_NO_TYP,");
		sql.append(" N_I_N_R_PLN_DT,");
		sql.append(" MFCC_CD,");
		sql.append(" ODR_DVSN_CD,");
		sql.append(" DSP_SPCF_CTNT,");
		sql.append(" PKG_MSR,");
		sql.append(" SLS_TRDT_CD,");
		sql.append(" SLS_CRCY_CD,");
		sql.append(" SLS_UP_APL_BGN_DT,");
		sql.append(" SLS_UP_APL_END_DT,");
		sql.append(" SLS_UP,");
		sql.append(" SLS_UP_D_L_PLC,");
		sql.append(" SLS_UP_APL_BGN_DT2,");
		sql.append(" SLS_UP_APL_END_DT2,");
		sql.append(" SLS_UP2,");
		sql.append(" SLS_UP_D_L_PLC2,");
		sql.append(" I_N_S_DCTN_DT,");
		sql.append(" B_BPLN_ITM_NO,");
		sql.append(" RPL_DVSN_CD,");
		sql.append(" GFT_ITM_TYP,");
		sql.append(" IMP_ITM_TYP,");
		sql.append(" DSP_ITM_TYP,");
		sql.append(" CNSMT_ITM_TYP,");
		sql.append(" SLS_PRMT_ITM_TYP,");
		sql.append(" PUR_ITM_TYP,");
		sql.append(" SLS_INNR_P_RT,");
		sql.append(" SLS_INNR_D_P_L_PLC,");
		sql.append(" SLS_INNR_P_RND_TYP,");
		sql.append(" SLS_STD_S_PRIZ,");
		sql.append(" SLS_TMP_S_PRIZ_TYP,");
		sql.append(" SLS_ODR_QTY_STD,");
		sql.append(" SLS_ODR_QTY_MAX,");
		sql.append(" SLS_ODR_QTY_MIN,");
		sql.append(" BPLN_PUR_PRIZ,");
		sql.append(" BPLN_SLS_PRIZ,");
		sql.append(" SLS_S_BGN_DT,");
		sql.append(" SLS_S_END_DT,");
		sql.append(" REAR_WHRS_CD,");
		sql.append(" SLS_ITM_ADM_TYP,");
		sql.append(" SLS_CAT_LRG,");
		sql.append(" SLS_CAT_MID,");
		sql.append(" SLS_CAT_SML,");
		sql.append(" SLS_SLS_DEPT,");
		sql.append(" PUR_UM,");
		sql.append(" INV_PUR_EXC_RT,");
		sql.append(" INV_UM,");
		sql.append(" DLVY_INV_EXC_RT,");
		sql.append(" DLVY_UM,");
		sql.append(" ADD_PRIZ_TAX_CD,");
		sql.append(" ADD_PRIZ_CAL_TYP,");
		sql.append(" ODR_MTHD,");
		sql.append(" SLS_SLS_CST_AC,");
		sql.append(" EMP1_ITM_TYP,");
		sql.append(" EMP2_ITM_TYP,");
		sql.append(" EMP3_ITM_TYP,");
		sql.append(" EMP4_ITM_TYP,");
		sql.append(" EMP5_ITM_TYP,");
		sql.append(" MAKER_KANSI_TYP,");
		sql.append(" PSI_ITM_TYP,");
		sql.append(" SLS_MIN_S_PRIZ,");
		sql.append(" SLS_PUR_PRIZ,");
		sql.append(" RGS_DTTM,");
		sql.append(" RGS_CHRG_CD,");
		sql.append(" RGS_PGID,");
		sql.append(" UPD_DTTM,");
		sql.append(" UPD_CHRG_CD,");
		sql.append(" UPD_PGID,");
		sql.append(" FM_TYP");
		sql.append(" FROM M03 WHERE");
		sql.append(" SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+"");
		sql.append(" AND");
		sql.append(" ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+"");
		sql.append(" AND");
		sql.append(" APL_EDT > "+((getString("SYSDATE").equals(""))?" is null ":"=")+getString("SYSDATE")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("NOT_FM_TYP")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public SelectResultRset SELECT_M0101(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" TRPT_NM_CN");
		sql.append(" FROM M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT <"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("NOT_FM_TYP_6")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_MDLNO01(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("SELECT ");
		sql.append("NVL(A.DCAT_CD ,       '') AS DCAT_CD ,");
		sql.append("NVL(B.GCAT_CD ,       '') AS GCAT_CD ");
		sql.append("FROM MDLNO A, DCAT B ");
		sql.append("WHERE ");
		sql.append("A.DCAT_CD = B.DCAT_CD(+) ");
		sql.append("AND ");
		sql.append("A.UNI_ITM_NO "+((getString("UNI_ITM_NO").equals(""))?" is null ":"=")+getString("UNI_ITM_NO")+" ");
		sql.append("AND ");
		sql.append("A.APL_BDT <"+((getString("nowDate").equals(""))?" is null ":"=")+getString("nowDate")+"  ");
		sql.append("AND ");
		sql.append("A.AC_END_DT >"+((getString("nowDate").equals(""))?" is null ":"=")+getString("nowDate")+" ");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}


	public void setAPL_EDT(String value){
		if(value==null) {
			paramsString.remove("APL_EDT");
			return;
		}
		paramsString.put("APL_EDT",value);
	}


	public void setUPD_DTTM(String value){
		if(value==null) {
			paramsString.remove("UPD_DTTM");
			return;
		}
		paramsString.put("UPD_DTTM",value);
	}


	public void setUPD_CHRG_CD(String value){
		if(value==null) {
			paramsString.remove("UPD_CHRG_CD");
			return;
		}
		paramsString.put("UPD_CHRG_CD",value);
	}


	public void setUPD_PGID(String value){
		if(value==null) {
			paramsString.remove("UPD_PGID");
			return;
		}
		paramsString.put("UPD_PGID",value);
	}


	public void setFM_TYP(String value){
		if(value==null) {
			paramsString.remove("FM_TYP");
			return;
		}
		paramsString.put("FM_TYP",value);
	}


	public void setSLCP_CD(String value){
		if(value==null) {
			paramsString.remove("SLCP_CD");
			return;
		}
		paramsString.put("SLCP_CD",value);
	}


	public void setITM_NO(String value){
		if(value==null) {
			paramsString.remove("ITM_NO");
			return;
		}
		paramsString.put("ITM_NO",value);
	}


	public void setAPL_BDT(String value){
		if(value==null) {
			paramsString.remove("APL_BDT");
			return;
		}
		paramsString.put("APL_BDT",value);
	}


	public void setSYSDATE(String value){
		if(value==null) {
			paramsString.remove("SYSDATE");
			return;
		}
		paramsString.put("SYSDATE",value);
	}


	public void setNOT_FM_TYP(String value){
		if(value==null) {
			paramsString.remove("NOT_FM_TYP");
			return;
		}
		paramsString.put("NOT_FM_TYP",value);
	}


	public void setODR_DVSN_CD(String value){
		if(value==null) {
			paramsString.remove("ODR_DVSN_CD");
			return;
		}
		paramsString.put("ODR_DVSN_CD",value);
	}


	public void setNOT_FM_TYP_6(String value){
		if(value==null) {
			paramsString.remove("NOT_FM_TYP_6");
			return;
		}
		paramsString.put("NOT_FM_TYP_6",value);
	}


	public void setNOT_FM_TYP_9(String value){
		if(value==null) {
			paramsString.remove("NOT_FM_TYP_9");
			return;
		}
		paramsString.put("NOT_FM_TYP_9",value);
	}


	public void setVDR_CD(String value){
		if(value==null) {
			paramsString.remove("VDR_CD");
			return;
		}
		paramsString.put("VDR_CD",value);
	}


	public void setUNI_ITM_NO(String value){
		if(value==null) {
			paramsString.remove("UNI_ITM_NO");
			return;
		}
		paramsString.put("UNI_ITM_NO",value);
	}


	public void setnowDate(String value){
		if(value==null) {
			paramsString.remove("nowDate");
			return;
		}
		paramsString.put("nowDate",value);
	}


}
